package com.saxon.servlet;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Skip extends HttpServlet {
    @Override
    protected void doGet (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println ("*******************************");
        ServletContext context = this.getServletContext ();
        RequestDispatcher r = context.getRequestDispatcher ("/gp");//写入要跳转的页面的url-pattern
        r.forward (req,resp);//    void forward(ServletRequest var1, ServletResponse var2) 一个请求，一个响应

    }

    @Override
    protected void doPost (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
       doGet (req, resp);
    }
}
